<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>植物大战僵尸</title>
    <style>
        body{
            height:100%;
            background:url(photo/background.jpg);
            background-size:cover
        }
        #pic{
            position:absolute;
            top:100px
        }
    </style>

</head>

<body>
<img id="pic"
     style="right:100px;"
     src="photo/1 (1).png" />

<script>
    var i = 1;
    function f(){
        if(i==32) i = 1;
        pic.src = "photo/1 ("+i+").png";
        i++;
    }
    setInterval(f,100);
    var j=100;
    function y(){
        if(j==1100){
            clearInterval(timer);
        }else{
            pic.style="right:"+j+"px";
            j=j+2;
        }

    }
    timer=setInterval(y,100);

</script>



</body>

</html>